package evolutionaryballoons.behavior.genetic;


public class MultipleNode implements Node {
	protected Node leftNode;
	protected Node rightNode;
	
	@Override
	public void perform(NodeInterface nodeInterface) {
		if (leftNode != null)
			leftNode.perform(nodeInterface);
		
		if (rightNode != null)
			rightNode.perform(nodeInterface);
	}
	
	public Node clone() {
		MultipleNode clone = new MultipleNode();
		clone.leftNode = (leftNode != null) ? leftNode.clone() : null;
		clone.rightNode = (rightNode != null) ? rightNode.clone() : null;
		
		return clone;
	}
}
